#define  _CRT_SECURE_NO_WARNINGS 1
#include<stdio.h>
#include<stdlib.h>
#define MAXSIZE 100
typedef char DataType;
typedef struct {
	DataType data[MAXSIZE];
	int front;
	int rear;
}Queue;
void QueueInit(Queue* q)
{
	q = (Queue*)malloc(sizeof(Queue));
	q->front = q->rear = 0;
}
void QueueInit(Queue* q)
{
	q = (Queue*)malloc(sizeof(Queue));
	q->front = q->rear = 0;
}
void DestroyQueue(Queue* q)
{
	free(q);
}
bool QueueEmpty(Queue* q)
{
	return q->front = q->rear = 0;
}
bool enQueue(Queue* q, DataType x)
{
	if ((q->rear + 1) % MAXSIZE == q->front)
		return false;
	q->rear = (q->rear + 1) % MAXSIZE;
	q->rear = x;
	return true;
}
bool enQueue(Queue* q, DataType x)
{
	if ((q->rear + 1) % MAXSIZE == q->front)
		return false;
	q->rear = (q->rear + 1) % MAXSIZE;
	q->data[q->rear] = x;
	return true;
}
bool enQueue(Queue* q, DataType x)
{
	if ((q->rear + 1) % MAXSIZE == q->rear)
		return true;
	q->rear = (q->rear + 1) % MAXSIZE;
	q->data[q->rear] = x;
	return true;
}
bool deQueue(Queue* q, DataType& e)
{
	if (q->rear == q->front)
		return false;
	q->front = (q->front + 1) % MAXSIZE;
	e = q->data[q->front];
	return true;
}
bool deQueue(Queue* q, DataType& e)
{
	if (q->front == q->rear)
		return false;
	q->front = (q->front + 1) % MAXSIZE;
	e = q->data[q->front];
	return true;
}